package com.prodavalnik.controller;

import com.prodavalnik.model.Product;

public class ProductFilter {

	String nameFilter;
	
	public ProductFilter(String name) {
		nameFilter = name.toUpperCase();
	}
	public boolean filterByName(Product product){
		if(nameFilter == null)
			return false;
		return product.getName().toUpperCase().indexOf(nameFilter)>-1;
	}
	public String getName(){
		return nameFilter;
	}

	
	
}
